/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SimpleTableTest.java
 *
 * Created on 24-06-2010, 23:12:06
 */
package gruppe1projekt.GUILayer.prototypes;

import gruppe1projekt.GUILayer.BaseWindow;
import gruppe1projekt.ModelLayer.RentableItem;
import java.util.ArrayList;

/**
 *
 * @author Moulde
 */
public class SimpleTableTest extends BaseWindow
{

    SimpleTable<RentableItem> table;
            
    /** Creates new form SimpleTableTest */
    public SimpleTableTest()
    {
        this.RequiresLogin = false;
        initComponents();

//        Product product1 = new Product("Is", "Desc", 134, null, 2394, 4, false);
//        Product product2 = new Product("Grisetryne", "Desc", 134, null, 34510, 4, false);
//        Product product3 = new Product("Monster", "Desc", 134, null, 598237, 4, false);
//        ArrayList<Product> products = new ArrayList<Product>();
//        products.add(product1);
//        products.add(product2);
//        products.add(product3);

        ArrayList<RentableItem> rcon = new ArrayList<RentableItem>();
        rcon.add(new RentableItem("Spade", "Dette er en spade", 50, 1337));
        rcon.add(new RentableItem("Hammer", "Dette er en hammer", 20, 1336));
        rcon.add(new RentableItem("Støvle", "Dette er en støvle", 10, 1334));
        rcon.add(new RentableItem("Båd", "Dette er en båd", 1000, 1333));
        rcon.add(new RentableItem("Søm", "Dette er søm", 10, 1332));

        table = new SimpleTable<RentableItem>(rcon);

        insertPanel(pnlTable, table);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlTable = new javax.swing.JPanel();

        javax.swing.GroupLayout pnlTableLayout = new javax.swing.GroupLayout(pnlTable);
        pnlTable.setLayout(pnlTableLayout);
        pnlTableLayout.setHorizontalGroup(
            pnlTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 380, Short.MAX_VALUE)
        );
        pnlTableLayout.setVerticalGroup(
            pnlTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 278, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlTable, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlTable, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel pnlTable;
    // End of variables declaration//GEN-END:variables
    }
